/*******************************************************************************
* @Filename      : bsp_lcd.h

* @Description   : bsp_lcd.h

* @Version       : 1.0.0

* @Date          : 2023.12.2
*******************************************************************************/

#ifndef __BSP_LCD_H
#define __BSP_LCD_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "bsp.h"

#ifdef _BSP_LCD_C
#define EXTERN
#else
#define EXTERN extern
#endif

/* Exported types ------------------------------------------------------------*/

/* Exported define -----------------------------------------------------------*/
#define LCD_DC_SET()  GPIO_SetBits(LCD_DC_PORT,   LCD_DC_PIN)
#define LCD_DC_CLR()  GPIO_ResetBits(LCD_DC_PORT, LCD_DC_PIN)

#define LCD_RES_SET() GPIO_SetBits(LCD_RES_PORT,   LCD_RES_PIN)
#define LCD_RES_CLR() GPIO_ResetBits(LCD_RES_PORT, LCD_RES_PIN)

#define LCD_CS_SET()  GPIO_SetBits(LCD_CS_PORT,   LCD_CS_PIN)
#define LCD_CS_CLR()  GPIO_ResetBits(LCD_CS_PORT, LCD_CS_PIN)

/* Exported constants --------------------------------------------------------*/

/* Exported variables --------------------------------------------------------*/
EXTERN uint8_t lcd_off;   //0:on 1:off

/* Exported functions --------------------------------------------------------*/
void BSP_LCD_Init(void);
void BSP_LCD_SetWindow(uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void BSP_LCD_DrawPic(uint32_t x, uint32_t y, uint32_t index, uint16_t no);
void BSP_LCD_DrawColor(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t color);
void BSP_LCD_DrawInterPic(void);
void BSP_LCD_Power_off(void);
void Draw_one_charater(uint8_t x, uint8_t y,char a, uint16_t color);
void Show_String(uint8_t x, uint8_t y, char *string,uint8_t String_long, uint16_t color);
void BSP_LCD_DrawColor2(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t color,uint16_t bg_color);
void BSP_LCD_Draw_jpg(const uint8_t *p,uint32_t x,uint32_t y,uint32_t w,uint32_t h);
void BSP_LCD_Display_On(void);
void Show_one_chinese_char(uint8_t x, uint8_t y,uint8_t* text, uint16_t color);
void Show_Chinese_String(uint8_t x, uint8_t y, uint8_t *string,uint8_t len);
void Show_Number_24x24(uint8_t x, uint8_t y, char *string,uint8_t len);
void Draw_one_number_24x24(uint8_t x, uint8_t y,char a, uint16_t color);

#ifdef __cplusplus
}
#endif
#endif

/* End of File ---------------------------------------------------------------*/
